from extensions.ext_database import db
from models.robot.rob_emoji import RobEmojiPack
from models.robot.rob_timbre import RobTimbreProvider

class RobotServerInitService:
    @staticmethod
    def init_server()->dict:
        emoji_packs = db.session.query(RobEmojiPack).all()
        emoji_pack_list = [emoji_pack.to_server_init_dict() for emoji_pack in emoji_packs]
        tts_providers = db.session.query(RobTimbreProvider).all()
        tts_provider_list = [tts_provider.to_server_init_dict() for tts_provider in tts_providers]
        return {
            "code":"success",
            "emoji_packs":emoji_pack_list,
            "tts_providers":tts_provider_list
        }